import _axios from '@/assets/js/http'

// 不良原因
export const getReasonType = () => {
    let options = {
        url: api.base + '/systemDictionary/getByType/badReason',
        method: 'POST',
        headers: {
            "Content-Type": "application/json",
            "Accept": "application/json"
        }
    }
    return _axios(options)
}
// 查询
export const doSearch = param => {
    let options = {
        url: api.supplier + '/supplierBadReason/list',
        // url: 'api/supplierBadReason/list',
        method: 'POST',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 新增不良原因的名称
export const addBadReason = (param) => {
    let options = {
        url: api.supplier + '/supplierBadReason',
        method: 'POST',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 编辑
export const modifyStatus = (param) => {
    let options = {
        url: api.supplier + '/supplierBadReason',
        method: 'PUT',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 是否启用
export const changeStatus = (param) => {
    let options = {
        url: api.supplier + '/supplierBadReason/updateStatus',
        method: 'POST',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 新增不良原因的分类
export const addReasonTypeName = (param) => {
    let options = {
        url: api.supplier + '/supplierBadReason/addType',
        // url: 'api/supplierBadReason/addType',
        method: 'POST',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}
// 编辑不良原因的分类
export const editReasonTypeName = (param) => {
    let options = {
        url: api.supplier + '/supplierBadReason/updateType',
        // url: 'api/supplierBadReason/updateType',
        method: 'POST',
        data: JSON.stringify(param),
        headers: {
            "Content-Type": 'application/json', 'Accept': 'application/json'
        }
    }
    return _axios(options)
}